/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.business.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import me.zhengjie.base.BaseBusiness;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
* @website https://el-admin.vip
* @description /
* @author xiahongbo
* @date 2022-04-13
**/
@Entity
@Data
@Table(name="BIS_SNRY")
public class Snry extends BaseBusiness implements Serializable {

    @Id
    @GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
    @GeneratedValue(generator = "hibernate-uuid")
    @Column(name = "BIS_SNRY_ID")
    @ApiModelProperty(value = "失能人员ID")
    private String bisSnryId;

    @Column(name = "BIS_SNRY_HLJG_ID")
    @ApiModelProperty(value = "护理机构ID")
    private Long bisSnryHljgId;

    @Column(name = "BIS_SNRY_XM")
    @ApiModelProperty(value = "姓名")
    private String bisSnryXm;

    @Column(name = "BIS_SNRY_XB")
    @ApiModelProperty(value = "性别")
    private String bisSnryXb;

    @Column(name = "BIS_SNRY_SFZ")
    @ApiModelProperty(value = "身份证")
    private String bisSnrySfz;

    @Column(name = "BIS_SNRY_LXDH")
    @ApiModelProperty(value = "联系电话")
    private String bisSnryLxdh;

    @Column(name = "BIS_SNRY_HLDZ_SSQX")
    @ApiModelProperty(value = "护理地址所在区县")
    private String bisSnryHldzSsqx;

    @Column(name = "BIS_SNRY_HLDZ_XXDZ")
    @ApiModelProperty(value = "详细地址")
    private String bisSnryHldzXxdz;

    @Column(name = "BIS_SNRY_HLDZ")
    @ApiModelProperty(value = "护理地址")
    private String bisSnryHldz;

    @Column(name = "BIS_SNRY_JD")
    @ApiModelProperty(value = "经度")
    private String bisSnryJd;

    @Column(name = "BIS_SNRY_WD")
    @ApiModelProperty(value = "纬度")
    private String bisSnryWd;

    @Column(name = "BIS_SNRY_JHRXM")
    @ApiModelProperty(value = "监护人姓名")
    private String bisSnryJhrxm;

    @Column(name = "BIS_SNRY_JHRDH")
    @ApiModelProperty(value = "监护人电话")
    private String bisSnryJhrdh;

    @Column(name = "BIS_SNRY_GX")
    @ApiModelProperty(value = "与失能人员关系")
    private String bisSnryGx;

    @Column(name = "BIS_SNRY_JHRSFZ")
    @ApiModelProperty(value = "监护人身份证")
    private String bisSnryJhrsfz;

    @Column(name = "BIS_SNRY_SQYY")
    @ApiModelProperty(value = "申请原因")
    private String bisSnrySqyy;

    @Column(name = "BIS_SNRY_USER_ID")
    @ApiModelProperty(value = "用户ID")
    private Long bisSnryUserId;

    @OneToMany
    @JoinColumn(name="BIS_ZHSQ_SNRY_ID", referencedColumnName="BIS_SNRY_ID")
    private List<Zhsq> zhsqs;

    @Column(name = "BIS_SNRY_GRBH")
    @ApiModelProperty(value = "个人编号")
    private String bisSnryGrbh;

    @Column(name = "BIS_SNRY_YBKH")
    @ApiModelProperty(value = "医保卡号")
    private String bisSnryYbkh;

    @Column(name = "BIS_SNRY_CBLX")
    @ApiModelProperty(value = "参保类型")
    private String bisSnryCblx;

    @Column(name = "BIS_SNRY_CBTCQ")
    @ApiModelProperty(value = "参保统筹区")
    private String bisSnryCbtcq;

    @Column(name = "BIS_SNRY_HLDZ_SSJD")
    @ApiModelProperty(value = "护理地址所在街道")
    private String bisSnryHldzSsjd;

    public void copy(Snry source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
    @Override
    public int hashCode() {
        return Objects.hash(bisSnryId, bisSnrySfz);
    }
}